package com.newlink.building.main.mvp.contract

import com.newlink.building.common_base.base.IModel
import com.newlink.building.common_base.base.IPresenter
import com.newlink.building.common_base.base.IView
import com.newlink.building.common_base.model.bean.*
import io.reactivex.Observable

/**
 * Created by xiaodong on 2022/9/26.
 */
class Module_Main_HomeContract {
    interface View : IView {
        fun refreshDeviceList(total: Int, data: MutableList<DeviceData>)
        fun refreshDoorInfo(data: MutableList<DoorData>)
        fun openDoorResult(result: OpenDoorResult)
        fun getMissedCallsSuccess(hasUnreadMsg: Boolean)
        fun getUnreadFlagSuccess(haveUnread: Boolean?, msgNum: Int, noticeNum: Int)
        fun getPrjListSuccess(data: MutableList<ProjectData>)
        fun getRecordUnreadPromptSuccess(result: RecordMessageReadResult)
    }

    interface Presenter : IPresenter<View> {
        fun getDeviceList(request: DeviceListRequest)
        fun getDoorInfo(token: String, mac: String)
        fun openDoorAction(request: OpenDoorRequest)
        fun getMissedCalls(token: String)
        fun getUnreadFlag(token: String, type: Int)
        fun getPrjList(token: String)
        fun getRecordUnreadPrompt(token: String, prjId: Long)
    }

    interface Model : IModel {
        fun getDeviceList(request: DeviceListRequest): Observable<HttpResult<DeviceListData>>
        fun getDoorInfo(token: String, mac: String): Observable<HttpResult<MutableList<DoorData>>>
        fun openDoorAction(request: OpenDoorRequest)
        fun getMissedCalls(token: String): Observable<HttpResult<Int>>
        fun getUnreadFlag(token: String, type: Int): Observable<HttpResult<MessageReadResult>>
        fun getPrjList(token: String): Observable<HttpResult<MutableList<ProjectData>>>
        fun getRecordUnreadPrompt(
            token: String,
            prjId: Long
        ): Observable<HttpResult<RecordMessageReadResult>>
    }
}